// promise 限流/限制并发/撤销promise


function createDealPromise() {

    const queue = [];
    let count = 0; // 记录正在处理的 promise

    function dealPromise(promise) {
        queue.push();
        if(count <= 3) {
            count++;
            // 处理 promise 
            (async () => {
                await queue.shift().then().finaly(e => {count--;});
            })();
            
        }

    }

}




